package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.QianbaoBean;
import com.lwj.liwanjia.impl.QiabaoView;
import com.lwj.liwanjia.model.QianbaoModel;

import rx.Subscriber;

/**
 * Created by Administrator on 2018/1/18.
 */

public class QianbaoPresenter {
    private QiabaoView qiabaoView;
    private QianbaoModel qianbaoModel;

    public QianbaoPresenter(QiabaoView qiabaoView) {
        this.qiabaoView = qiabaoView;
        qianbaoModel = new QianbaoModel();
    }
    public void getQianbaoData(String token){
        qianbaoModel.getQianbaoData(token, new Subscriber<QianbaoBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
            qiabaoView.showError((Exception) e);
            }

            @Override
            public void onNext(QianbaoBean qianbaoBean) {
            qiabaoView.getQiaobaoData(qianbaoBean);
            }
        });
    }
}
